package com.kingsoft.dc.khaos

import com.kingsoft.dc.khaos.innertype.Schema
import com.kingsoft.dc.khaos.metadata.Dependency

/**
  * Created by chengguangqing on 2019/6/2.
  */
class SchemaChannel {
  private var _declare = Map[Dependency, Schema]()

  def declare(schema: Schema): Unit = {
    declare(Dependency(null, null, "default"), schema)
  }

  def declare(dependency: Dependency, schema: Schema): Unit = {
    _declare += (dependency -> schema)
  }

  def getSchema(dependency: Dependency): Schema = {
    _declare.get(dependency).orNull
  }
}
